#pragma once
#include "../common/lua_version.h"
#include "lua_utils.h"
#include <mutex>

class lua_thread
{
public:

    static void initialize(lua_State* L, const char* lib_name);
    static void uninitialize();

    static int id(lua_State* L);
    static int create(lua_State* L);
    static int create_ex(lua_State* L);
    static int clear(lua_State* L);
    static int sleep(lua_State* L);
    static int lock(lua_State* L);
    static int unlock(lua_State* L);

private:
    static std::mutex m_mutex;
    static std::mutex m_create_mutex;
};
